package com.mouse.damo.micro;

import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Variant;

public class Setting {
    private ActiveXComponent activeDm = null;
    private Com com = null;

    public Setting(Com com) {
        this.com = com;
        this.activeDm = com.getActiveDm();
    }



    /**
     * CPU优化，降低界面刷新的CPU占用
     *
     * @param num 取值范围0到100   取值为0 表示关闭CPU优化. 这个值越大表示降低CPU效果越好.
     * @return boolean
     */
    public boolean lowerCpu(int num) {
        boolean xnx3_result = false;
        try {
            if (activeDm.invoke("DownCpu", num).getInt() == 1) {
                xnx3_result = true;
            }
        } catch (Exception e) {
            e.printStackTrace();
            //log.debug(this, "lowerCpu", "异常:"+e.getMessage());
        }
        return xnx3_result;
    }

}
